package com.gongyibao.gbase.service.impl;

import com.gongyibao.gbase.entity.TDepartment;
import com.gongyibao.gbase.mapper.TDepartmentMapper;
import com.gongyibao.gbase.service.TDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TDepartmentServiceImpl implements TDepartmentService {

    @Autowired
    private TDepartmentMapper tDepartmentMapper;

    @Override
    public TDepartment getDepartmentById(Integer id) {
        return tDepartmentMapper.selectByPrimaryKey(id);
    }

    @Override
    public Boolean insertDepartment(TDepartment Department) {
        return tDepartmentMapper.insert(Department) > 0;
    }

    @Override
    public Boolean updateDepartment(TDepartment Department) {
        return tDepartmentMapper.updateByPrimaryKeySelective(Department) > 0;
    }

    @Override
    public Boolean delDepartment(Integer id) {
        return tDepartmentMapper.deleteByPrimaryKey(id) > 0;
    }

}